import appConfig from '@/config/app.js';
import {getRequest, postRequest} from '@/server/request.js';

/**
 * 用户注册
 * @param formData
 * @returns {Promise<axios.AxiosResponse<*>>|*}
 */
export function registerService(formData) {
    return postRequest(appConfig.apiHost + '/v1/user/register', formData);
}

/**
 * 用户登录
 * @param formData
 * @returns {Promise<axios.AxiosResponse<*>>|*}
 */
export function loginService(formData) {
    return postRequest(appConfig.apiHost + '/v1/user/login', formData);
}

/**
 * 获取用户信息
 * @returns {Promise<axios.AxiosResponse<*>>|*}
 */
export function userInfoService() {
    return getRequest(appConfig.apiHost + '/v1/user/info', {});
}